import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 用户关系
 */
@Entity('user_relation')
export class UserRelationEntity extends BaseEntity {
  @Index()
  @Column({ comment: '用户ID' })
  userId: number;

  @Index()
  @Column({ comment: '上级用户ID', nullable: true })
  parentId: number;

  @Column({ comment: '层级', default: 0 })
  level: number;

  @Column({ comment: '一级上级ID', nullable: true })
  level1ParentId: number;

  @Column({ comment: '二级上级ID', nullable: true })
  level2ParentId: number;

  @Column({ comment: '三级上级ID', nullable: true })
  level3ParentId: number;
}
